package com.hejia.alauda.entity;

import javax.persistence.Column;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

import com.hejia.alauda.Constants;

/**
 * 
 * 银行信息实体,合家支持的支付银行
 * 
 *
 *
 * Created by showone on 2014 上午11:01:20.
 *
 * @Copyright: 2014 www.hejiajinrong.com All rights reserved.
 */
@JsonIgnoreProperties(value = { "createDate", "modifyDate", "payGate",
		"payBankCode","webPaygate","h5Paygate","iOSPaygate","androidPaygate" })
public class BankInfo extends BaseEntity {
	private static final long serialVersionUID = 1L;

	@Column(length = 50)
	private String bankName;// 银行名称

	@Column(length = 10)
	private String bankCode;// 银行编码

	@Column(length = 100)
	private String maxPayInfo;// 支付限额信息

	@Column(length = 10)
	private String payGate;// 支付网关

	@Column(length = 10)
	private String payBankCode;// 支付银行编码

	@Column(length = 10)
	private PayGate webPaygate;// web支付网关

	@Column(length = 10)
	private PayGate h5Paygate;// h5支付网关

	@Column(length = 10)
	private PayGate iOSPaygate;// iOS支付网关

	@Column(length = 10)
	private PayGate androidPaygate;// android支付网关
	
	@Column
	private Boolean bindable;// 是否可绑卡

	private Boolean useable;// 是否可用


	public String getBankName() {
		return bankName;
	}

	public void setBankName(String bankName) {
		this.bankName = bankName;
	}

	public String getBankCode() {
		return bankCode;
	}

	public void setBankCode(String bankCode) {
		this.bankCode = bankCode;
	}

	public String getMaxPayInfo() {
		return maxPayInfo;
	}

	public void setMaxPayInfo(String maxPayInfo) {
		this.maxPayInfo = maxPayInfo;
	}

	public String getPayGate() {
		return payGate;
	}

	public void setPayGate(String payGate) {
		this.payGate = payGate;
	}

	public String getPayBankCode() {
		return payBankCode;
	}

	public void setPayBankCode(String payBankCode) {
		this.payBankCode = payBankCode;
	}

	public PayGate getWebPaygate() {
		return webPaygate;
	}

	public void setWebPaygate(PayGate webPaygate) {
		this.webPaygate = webPaygate;
	}

	public PayGate getH5Paygate() {
		return h5Paygate;
	}

	public void setH5Paygate(PayGate h5Paygate) {
		this.h5Paygate = h5Paygate;
	}

	public PayGate getiOSPaygate() {
		return iOSPaygate;
	}

	public void setiOSPaygate(PayGate iOSPaygate) {
		this.iOSPaygate = iOSPaygate;
	}

	public PayGate getAndroidPaygate() {
		return androidPaygate;
	}

	public void setAndroidPaygate(PayGate androidPaygate) {
		this.androidPaygate = androidPaygate;
	}


	/**
	 * 获取支付网关
	 * 
	 * @param os
	 * @return
	 */
	public PayGate getPayGate(String os) {
		PayGate payGateCode = null;
		if (Constants.PLATFORM_IOS.equalsIgnoreCase(os)) {
			payGateCode = getiOSPaygate();
		} else if (Constants.PLATFORM_ANDORID.equalsIgnoreCase(os)) {
			payGateCode = getAndroidPaygate();
		} else if (Constants.PLATFORM_H5.equalsIgnoreCase(os)) {
			payGateCode = getH5Paygate();
		} else {
			payGateCode = getWebPaygate();
		}
		return payGateCode;
	}

	public Boolean getUseable() {
		return useable;
	}

	public void setUseable(Boolean useable) {
		this.useable = useable;
	}

	public Boolean getBindable() {
		return bindable;
	}

	public void setBindable(Boolean bindable) {
		this.bindable = bindable;
	}
}
